class Solution {
public:
    bool is_vowel(const string& str)
    {
        static string table("aeiou");
        return table.find(str[0]) != string::npos && table.find(str.back()) != string::npos;
    }

    int vowelStrings(std::vector<std::string>& words, int left, int right) 
    {
        int s = 0;
        for (int i = left; i <= right; i++)
        {
            if (is_vowel(words[i]))
                s++;
        }
        return s;
    }
};
